On the Transformation between Direct and Continuation Semantics
نویسندگان
چکیده
Proving the congruence between a direct semantics and a continuation semantics is often surprisingly complicated considering that direct-style-terms can be transformed into continuation style automatically. However, transforming the representation of a direct-style semantics into continuation style usually does not yield the expected representation of a continuation-style semantics (i.e., one written by hand). The goal of our work is to automate the transformation between textual representations of direct semantics and of continuation semantics. Essentially, we identify properties of a direct-style representation (e.g., totality), and we generalize the transformation into continuation style accordingly. As a result, we can produce the expected representation of a continuation semantics, automatically. It is important to understand the transformation between representations of direct and of continuation semantics because it is these representations that get processed in any kind of semantics-based program manipulation (e.g., compiling, compiler generation, and partial evaluation). A tool producing a variety of continuation-style representations is a valuable new one in a programming-language workbench.
منابع مشابه
A Selective CPS Transformation
The CPS transformation makes all functions continuation-passing, uniformly. Not all functions, however, need continuations: they only do if their evaluation includes computational effects. In this paper we focus on control operations, in particular “call with current continuation” and “throw”. We characterize this involvement as a control effect and we present a selective CPS transformation tha...
متن کاملIs Continuation-passing Useful for Data Flow Analysis? 2 : Syntax and Semantics
The widespread use of the continuation-passing style (CPS) transformation in compilers, optimizers, abstract interpreters, and partial evaluators reeects a common belief that the transformation has a positive eeect on the analysis of programs. Investigations by Nielson 13] and Burn/Filho 5, 6] support, to some degree , this belief with theoretical results. However, they do not pinpoint the sour...
متن کاملData Flow Analysis of Programs in CPSMany
The widespread use of the continuation-passing style (CPS) transformation in compilers, opti-mizers, abstract interpreters, and partial evaluators reeects a common belief that the transformation has a positive eeect on the analysis of programs. Investigations by Nielson 14] and Burn/Filho 5, 6] support, to some degree, this belief with theoretical results. However, these investigations do not p...
متن کاملSharing Continuations: Proofnets for Languages with Explicit Control
We introduce graph reduction technology that implements functional languages with control, such as Scheme with call/cc, where continuations can be manipulated explicitly as values, and can be optimally reduced in the sense of Lévy. The technology is founded on proofnets for multiplicative-exponential linear logic, extending the techniques originally proposed by Lamping, where we adapt the conti...
متن کامل